#!/bin/ksh
# @(#)25        1.75  src/sysmgt/dsm/bin/pccLinks.sh, websm, r31.hsc, hsc_wsm_051002 5/9/02 10:12:59";


DEFAULT_LANG=`echo $LANG`
DEFAULT_DIR=/srv/www/htdocs

if [ $# -gt 0 ] ; then
  if [ "$1" = "-lang" ] ; then
     PCC_LANG="$2"
  fi
  if [ "$3" = "-dir" ] ; then
     PCC_DIR="$4"
  fi
fi

if [ "${PCC_LANG}" = "" ] ; then
  PCC_LANG=${DEFAULT_LANG}
fi

if [ "${PCC_DIR}" = "" ] ; then
  PCC_DIR=${DEFAULT_DIR}
fi

cd ${PCC_DIR}

# These are being changed for r51.hsc and r42.hsc to always point
# to en_US because translations are not available for the new
# pages.  This will be corrected when translations are ready.
ln -sf html/${PCC_LANG}/chooseClient.html chooseClient.html
ln -sf html/${PCC_LANG}/pc_client.html pc_client.html
ln -sf html/${PCC_LANG}/pc_client.html remote_client.html
ln -sf html/${PCC_LANG}/pc_client_security.html pc_client_security.html
ln -sf html/${PCC_LANG}/pc_client_security.html remote_client_security.html
ln -sf html/${PCC_LANG}/pccwarning.html pccwarning.html
ln -sf html/${PCC_LANG}/websm_webstart.html websm_webstart.html


ln -sf html/${PCC_LANG}/pcctoc.html 	pcctoc.html
ln -sf html/${PCC_LANG}/wsmsec_not_installed.html wsmsec_not_installed.html
ln -sf html/${PCC_LANG}/wsmsec_installed.html wsmsec_installed.html
ln -sf html/${PCC_LANG}/wsmbanner.html wsmbanner.html

# If one of the security .exe files is installed, then set the pccsecwarning.html
# link to allow download, else link it to an informative message
J=/usr/websm/pc_client/setupsec-ex.exe
K=/usr/websm/pc_client/setupsec-us.exe
L=/usr/websm/pc_client/setupsecl-ex.exe
M=/usr/websm/pc_client/setupsecl-us.exe


if [ -f ${J} -o -f ${K} -o -f ${L} -o -f ${M} ]
then
	ln -sf html/${PCC_LANG}/wsmsec_installed.html pccsecwarning.html
else
	ln -sf html/${PCC_LANG}/wsmsec_not_installed.html pccsecwarning.html
fi
